package com.redis.Service.Impl;

import com.redis.Dao.ShopDao;
import com.redis.Service.ShopBiz;
import com.redis.vo.ShopEntity;
import com.redis.vo.SpikeEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ResponseStatus;

import javax.annotation.Resource;

@Service
public class ShopBizImpl implements ShopBiz {
    @Resource
    private ShopDao shopDao;

    //查询商品库存
    public ShopEntity shopNum(int shopId) {
        return shopDao.shopNum(shopId);
    }
    //修改商品的库存
    public int updateNumber(int shopId) {
        return shopDao.updateNumber(shopId);
    }
    //插入秒杀信息到spike表
    public int insertSpike(int shopId, int userId, String userName) {
        return shopDao.insertSpike(shopId, userId, userName);
    }
    //通过shopId查询商品名
    public String queryShopName(int shopId){
        return shopDao.queryShopName(shopId);
    }
    //通过商品名查询
    public ShopEntity seek(String shopName){
        return shopDao.seek(shopName);
    }
}
